package com.means.polymerize.common.constants;

import cn.dev33.satoken.stp.StpUtil;
import lombok.extern.slf4j.Slf4j;

/**
 * @author xuahifeng
 * @since 2021.10.29
 */
@Slf4j
@SuppressWarnings("unused")
public class LoginInfo {
    public static final String LOGIN_INFO = "LOGIN_INFO";

    /**
     * 设置登录信息
     */
    public void setLoginInfo() {
        if (StpUtil.isLogin()) {
            StpUtil.getSession().set(LOGIN_INFO, "");
        }
    }

    /**
     * 获取登录信息
     *
     * @return Object
     */
    public Object getLoginInfo() {
        if (StpUtil.isLogin()) {
            return StpUtil.getSession().get(LOGIN_INFO);
        }
        return new Object();
    }

}
